//
//  WYCMessegeCell.m
//  51信用卡
//
//  Created by 中企互联 on 2017/11/2.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import "WYCMessegeCell.h"

@implementation WYCMessegeCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    WYCMessegeCell * cell = [tableView dequeueReusableCellWithIdentifier:[WYCMessegeCell ID]];
    if (!cell) {
        cell = [[WYCMessegeCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[WYCMessegeCell ID]];
    }
    
    
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setMember];
        
    }
    return self;
}
//cell控件摆放
- (void)setMember{
    //背景cell
    UIView * backView = [[UIView alloc] init];
    backView.frame = CGRectMake(0, 0, ScreenWidth, 280 * px);
    backView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:backView];
    
    //通知
    UILabel * noticeLabel = [[UILabel alloc] init];
    noticeLabel.frame = CGRectMake(40 * px, 40 * px, 120 * px, 60 * px);
    noticeLabel.backgroundColor = bigredColor;
    noticeLabel.text = @"通知";
    noticeLabel.textColor = [UIColor whiteColor];
    noticeLabel.font = forLight;
    noticeLabel.textAlignment = NSTextAlignmentCenter;
    [backView addSubview:noticeLabel];
    
    
    //内容
    UILabel * contentLabel = [[UILabel alloc] init];
    contentLabel.frame = CGRectMake(CGRectGetMaxX(noticeLabel.frame)+ 40 * px, noticeLabel.y, backView.width - 120 * px - noticeLabel.width, noticeLabel.height * 2);
    contentLabel.text = @"真人秀对于大多明星来说是一次很好的机会，能够让观众认识角色以外最真实的自己！但对于明星的家人来说却未必会是一件好事！";
    contentLabel.numberOfLines = 0;
    contentLabel.font = forLight;
    contentLabel.textAlignment = NSTextAlignmentCenter;
    [backView addSubview:contentLabel];
    
    
    //通知
    UILabel * timeLabel = [[UILabel alloc] init];
    timeLabel.frame = CGRectMake(contentLabel.x, CGRectGetMaxY(contentLabel.frame) + 40 * px, noticeLabel.width * 2, 50 * px);
    timeLabel.text = @"2017.09.20";
    timeLabel.font = smallLight;
    timeLabel.textColor = WYZGrayBg;
    timeLabel.textAlignment = NSTextAlignmentCenter;
    [backView addSubview:timeLabel];
    
    
    //查看详情
    UILabel * detailedLabel = [[UILabel alloc] init];
    detailedLabel.frame = CGRectMake(backView.width - noticeLabel.width * 3, timeLabel.y, noticeLabel.width * 3, 50 * px);
    detailedLabel.text = @"查看详情 >";
    detailedLabel.textColor = WYZGrayBg;
    detailedLabel.font = smallLight;
    detailedLabel.textAlignment = NSTextAlignmentCenter;
    [backView addSubview:detailedLabel];
    
    
    
}

+(NSString *)ID{
    return @"cell";
}

@end
